<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
	</head>
	<body>
		<div id="app">
			<h3>{{message}}</h3>
			<h6>{{reversedMessage()}}</h6>
			<h6>{{reversedMessage()}}</h6>
			<h3>{{rmessage}}</h3>
			<h1>{{rmsg}}</h1>
			<h1>{{rmsg}}</h1>
			<h2>{{fullName}}</h2>
			<h2>{{fullName}}</h2>
		</div>
		<script type="text/javascript">
			const app = new Vue({
				el: '#app',
				data: {
					message: 'Hello',
					rmessage: '',
					// rmsg:'',
					firstName: '张',
					lastName: '三'
				},
				methods: {
					reversedMessage() {
						console.log("方法");
						this.rmessage = this.message.split("").reverse().join("");
						return this.message.split("").reverse().join("");
					}
				},
				computed: {
					rmsg() {
						console.log("计算属性")
						return this.message.split("").reverse().join("");
					},
					fullName() {
						console.log("重新计算");
						return this.firstName + this.lastName;
					}
				},
			})
		</script>
	</body>
</html>
